/**
 *  Class OtrUser is part of the project OtrMediaManager
    Copyright (C) 2014  Gerrit Eichel

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package otrmediamanager.otr;

/**
 * This class represents OTR user login credentials.
 */
public class OtrUser {
	
	/** The user name */
	private String _userName = null;
	/** The user password */
	private String _userPassword = null;

	/**
	 * Initializes a new OtrUser instance.  
	 * @param userName The user name.
	 * @param userPassword The user password.
	 */
	public OtrUser(String userName, String userPassword) {
		this.setUsername(userName);
		this.setUserPassword(userPassword);
	}
	/**
	 * Returns the OTR user name.
	 * @return The OTR user name.
	 */
	public String getUsername() {
		return this._userName;
	}
	/**
	 * Sets OTR user name.
	 * @param userName The OTR user name to be set.
	 */
	private void setUsername(String userName) {
		if (userName == null) {
			throw new java.lang.IllegalArgumentException("Property <Username> is not initialized!");
		}
		if (userName == "") {
			throw new java.lang.IllegalArgumentException("Property <Username> is empty!");
		}
		this._userName = userName;
	}
	/**
	 * Returns OTR user password.
	 * @return The OTR user password.
	 */
	public String getUserPassword() {
		return this._userPassword;
	}
	/**
	 * Sets OTR user password.
	 * @param userPassword The OTR user password.
	 */
	private void setUserPassword(String userPassword) {
		if (userPassword == null) {
			throw new java.lang.IllegalArgumentException("Property <UserPassword> is not initialized!");
		}
		if (userPassword == "") {
			throw new java.lang.IllegalArgumentException("Property <UserPassword> is empty!");
		}
		this._userPassword = userPassword;
	}
}
